<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Constant</title><link rel="stylesheet" type="text/css" href="eclipse_book.css"><meta name="generator" content="DocBook XSL Stylesheets V1.77.1"><link rel="home" href="index.html" title="Red Hat Fuse Tooling"><link rel="up" href="RiderExLang.html" title="Part&nbsp;III.&nbsp;Expression and Predicates Languages"><link rel="prev" href="Intro.html" title="Introduction"><link rel="next" href="EL.html" title="EL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="Constant"></a>Constant</h2></div></div></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33917"></a>Overview</h2></div></div></div><p>The constant language is a trivial built-in language that is used to specify a plain text
string. This makes it possible to provide a plain text string in any context where an
expression type is expected.</p></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33918"></a>XML example</h2></div></div></div><p>In XML, you can set the <code class="literal">username</code> header to the value, <code class="literal">Jane Doe</code>
as follows:</p><pre class="screen">&lt;camelContext&gt;
  &lt;route&gt;
    &lt;from uri="<span class="emphasis"><em>SourceURL</em></span>"/&gt;
    &lt;setHeader headerName="username"&gt;
      &lt;constant&gt;Jane Doe&lt;/constant&gt;
    &lt;/setHeader&gt;
    &lt;to uri="<span class="emphasis"><em>TargetURL</em></span>"/&gt;
  &lt;/route&gt;
&lt;/camelContext&gt;</pre></div><div class="simplesect"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="topic-33919"></a>Java example</h2></div></div></div><p>In Java, you can set the <code class="literal">username</code> header to the value, <code class="literal">Jane Doe</code>
as follows:</p><pre class="screen">from("<span class="emphasis"><em>SourceURL</em></span>")
  .setHeader("username", constant("Jane Doe"))
  .to("<span class="emphasis"><em>TargetURL</em></span>");</pre></div></div></body></html>